/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class CreateCriptogramaData {
	public void createTestData() throws PersistentException {
		PersistentTransaction t = orm.CriptogramaPersistentManager.instance().getSession().beginTransaction();
		try {
			orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
			orm.dao.Tcr_mensajeDAO oRMTcr_mensajeDAO = lDAOFactory.getTcr_mensajeDAO();
			orm.Tcr_mensaje oRMTcr_mensaje = oRMTcr_mensajeDAO.createTcr_mensaje();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : men_encriptado, men_desencriptado
			oRMTcr_mensajeDAO.save(oRMTcr_mensaje);
			orm.dao.Tcr_logDAO oRMTcr_logDAO = lDAOFactory.getTcr_logDAO();
			orm.Tcr_log oRMTcr_log = oRMTcr_logDAO.createTcr_log();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : log_tiempo, log_ftermino, log_finicio, log_evento
			oRMTcr_logDAO.save(oRMTcr_log);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			CreateCriptogramaData createCriptogramaData = new CreateCriptogramaData();
			try {
				createCriptogramaData.createTestData();
			}
			finally {
				orm.CriptogramaPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
